package org.to_zero.springboot.security.service.impl;


import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.to_zero.springboot.security.entity.Dept;
import org.to_zero.springboot.security.entity.vo.ResponseEntity;
import org.to_zero.springboot.security.mapper.DeptMapper;
import org.to_zero.springboot.security.service.DeptService;

import java.util.List;
import java.util.Objects;


@Service
public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements DeptService {

    @Override
    public ResponseEntity selectDeptSelective(Dept dept) {
        List<Dept> list = new LambdaQueryChainWrapper<>(baseMapper).eq(Objects.nonNull(dept.getId()), Dept::getId, dept.getId()).list();
        return ResponseEntity.success(list);
    }
}
